home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Demo's / Tools&Utilities / Programming / PowerLisp 1.1 / Library / stdlib.lisp < prev    next >
Encoding:
Text File  |  1994-03-25  |  1.2 KB  |  64 lines  |  [TEXT/ROSA]

  1. ;;
  2. ;;        Copyright © 1994 Roger Corman.  All rights reserved.
  3. ;;
  4. ;
  5. ;        Lisp standard functions and macros to be loaded at startup.
  6. ;
  7.  
  8. (defun copyright ()
  9.     "Copyright © 1994 Roger Corman")
  10.  
  11. (print (copyright))
  12. (print "Loading PowerLisp standard library...")
  13.  
  14. (make-package :compiler)
  15.  
  16. (print "this is a test")    
  17.  
  18. ;; this is only needed to load the standard library,
  19. ;; which then rolls this functionality into 'load'.
  20. (defun load-binary (filename)
  21.     (let*
  22.         ((loaded 0)
  23.          (stream (open filename))
  24.          (*package* *package*)            ;; bind these to themselves
  25.          (*readtable* *readtable*)
  26.          (*standard-output* *standard-output*))
  27.          
  28.         (do* ((expr t) (symbol-table (make-array 500)))
  29.             ((null expr)(close stream) loaded)
  30.             (setq expr (%read-code-from-stream stream symbol-table))
  31.             (if expr
  32.                 (let ((result (funcall expr)))
  33.                     (setq loaded (+ 1 loaded)))))))
  34.  
  35. (if (probe-file ":library:cl.fasl")
  36.     (progn 
  37.         (load-binary ":library:cl.fasl")
  38.         (print "Standard Library (binary) loaded."))
  39.     (if (probe-file ":library:cl.lisp")
  40.         (progn
  41.             (load ":library:cl.lisp")
  42.             (print "Standard Library loaded."))
  43.         (print "Could not find Standard Library.")))
  44.  
  45. (print "this is another test")    
  46. (setq *prompt* #'prompt)
  47.  
  48. ; garbage collect
  49. ;(gc)
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.